//
//  YFILikeCell.m
//  project
//
//  Created by Winny Zhang on 2019/3/25.
//  Copyright © 2019 健健. All rights reserved.
//

#import "YFILikeCell.h"
#import "YFLikeModel.h"
#import "YFJourneyTagView.h"

@interface YFILikeCell ()

/**
 背景 View
 */
@property (weak, nonatomic) IBOutlet UIView *bgContentView;

/**
 头像imageView
 */
@property (weak, nonatomic) IBOutlet UIImageView *avatarImageView;
/**
 姓名 年龄 职业 Label
 */
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
/**
 性别 ImageView
 */
@property (weak, nonatomic) IBOutlet UIImageView *genderImageView;



@end

@implementation YFILikeCell

- (void)setLikeModel:(YFLikeRecordModel *)likeModel {
    _likeModel = likeModel;
    [self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:likeModel.user.avatar] placeholderImage:nil];
    self.genderImageView.image = likeModel.user.sexImage;
    self.nameLabel.text = [NSString stringWithFormat:@"%@ %@岁 %@",likeModel.user.nickName,likeModel.user.age,likeModel.user.vocationName.length == 0 ? @"" : likeModel.user.vocationName];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor = [UIColor clearColor];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    [self setupViews];
}

- (void)setupViews {
    [self.bgContentView rounded:UIRectCornerAllCorners radius:6];
    // 用户图片 圆角
    [self.avatarImageView rounded:(UIRectCornerAllCorners) radius:self.avatarImageView.height/2  borderColor:[UIColor colorWithHex:0x000000] borderWidth:1];
}


@end
